from pydantic import BaseModel
from typing import Any, Optional, Generic, TypeVar

T = TypeVar('T')

class Token(BaseModel):
    access_token: str
    token_type: str = "bearer"

class ErrorSchema(BaseModel):
    detail: str

class R(BaseModel, Generic[T]):
    code: int
    message: str
    data: Optional[T] = None